#include "common.h"
#include <signal.h>
#include <sys/wait.h>

void signal_handler(int signum)
{
	printf("rev Signum : %d\n", signum);
}

int main()
{
	pid_t pid;
	pid = fork();

	if(pid < 0)
		err_sys("fork error\n");
	else if(pid == 0)
	{
		printf("Child ppid : %d\n", getppid());
		sleep(5);
		kill(getppid(), SIGALRM);
	}
	else
	{
		signal(SIGALRM, signal_handler);
		pause();
		printf("Parent pid : %d\n", getpid());
	}

	return 0;
}
